-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I noticed that when $source refers to a relative URL, the value retur… #106
base: master
Are you sure you want to change the base?
Conversation
…ned from parse_url() is false. This causes a Deprecated warning message to be displayed when strpos() is called a few lines later. This change avoids that issue and reduces non-fatal messages from being displayed.
What about changing |
how about adding an http (or https) on the URL if it’s missing, then proceed as it is now? |
An example of a URL that's causing this is: empty() returns a true on empty strings as well as integer, float and string '0'/zero values. So it's a bit inaccurate in some cases. If, somehow, the domain name is '0' (unlikely, I know, but...) it'll think it's empty when it isn't. That's why I'm suggesting the change submitted. :) |
is this potentially happening anywhere else? (maybe stylesheets as well) @johnbillion thoughts? |
Yes, it looks like it could be happening in block_style_load() as well but I haven't seen any deprecated warnings in the log file from that. |
Where are those three leading slashes on the URL coming from? |
I don't know. It could be from the theme (Astra on this test site). I didn't dig too deep on that since it's not affecting the call to parse_url() itself. |
ok i'm aware this is over a year old and i'm gonna blame the pandemic. doing some quick testing, i'm finding that a relative URL correctly using two slashes ( so was that 3rd slash a typo, or was that actually the attempted URL to load? because |
…ned from parse_url() is false. This causes a Deprecated warning message to be displayed when strpos() is called a few lines later. This change avoids that issue and reduces non-fatal messages from being displayed.